class Solution(object):
    def canConstruct(self, ransomNote, magazine):
        """
        :type ransomNote: str
        :type magazine: str
        :rtype: bool
        """
        cDict = {}
        for c in magazine:
            if c not in cDict:
                cDict.update({c:0})
            cDict[c]+=1
        rDict = {}
        for c in ransomNote:
            if c not in rDict:
                rDict.update({c:0})
            rDict[c]+=1
        for key,value in rDict.items():
            if key in cDict and value<=cDict[key]:
                continue
            else:
                return False
        return True